//
//  addOrderStore.m
//  NewPro
//
//  Created by 何荧红 on 2019/4/28.
//  Copyright © 2019 何荧红. All rights reserved.
//

#import "addOrderStore.h"

@implementation addOrderStore



#pragma mark 添加订单
- (void)addOrderWithPrams:(NSDictionary *)prams AndType:(NSInteger )type Success:(void(^)(NSDictionary *res))success Failure:(void(^)(NSError *error))failure{
    NSString *url = @"";
    if (type == 2) {
        url = [NSString stringWithFormat:@"%@/api/order/addOrder",IP];
    }else if(type == 1){
        url = [NSString stringWithFormat:@"%@/api/order/materials",IP];
    }
    [HttpTool postUrlWithString:url parameters:prams success:^(id responseObject) {
        NSError *error = [HttpTool inspectError:responseObject];
        if (error == nil) {
            success(responseObject);
        }else{
            failure(error);
        }
    } failure:^(NSError *error) {
        failure(error);
    }];
}



@end
